<h1>Schools Management</h1>
<span class="subMnu">
	<a href="/new-school.html" title="Create New School">New...</a>
</span>
<?php
	$list = $mvc->getObject('list');
	if(!isset($list) || count($list) == 0){
?>
<span class="message">No schools available at this moment.</span>
<?php } else { ?>

<table class="list">
<tr class="title">
	<td>Caption:</td>
	<td>Alias:</td>
	<td>Rate:</td>
	<td>Options:</td>
</tr>
<?php foreach($list as $key => $value){ ?>
	<tr  style="border: 1px solid #EFEFEF">
		<td>
			<a href=<?php echo 'school-details.html?id=' . $value[SchoolService::ID];?>>
				<?php echo isset($value[SchoolService::CAPTION]) ? $value[SchoolService::CAPTION] : null;?>
			</a>
		</td>
		<td>
			<?php echo isset($value[SchoolService::ALIAS]) ? $value[SchoolService::ALIAS] : null;?>
		</td>
		<td>
			<?php if(isset($value[SchoolService::RATE])){ if($value[SchoolService::RATE] == 0){ ?>
			<a href="">[0]</a> <?php }else{ ?> <a href="">0</a> <?php } } ?> 
			<?php if(isset($value[SchoolService::RATE])){ if($value[SchoolService::RATE] == 1){ ?>
			<a href="">[1]</a> <?php }else{ ?> <a href="">1</a> <?php } } ?>
			<?php if(isset($value[SchoolService::RATE])){ if($value[SchoolService::RATE] == 2){ ?>
			<a href="">[2]</a> <?php }else{ ?> <a href="">2</a> <?php } } ?>
			<?php if(isset($value[SchoolService::RATE])){ if($value[SchoolService::RATE] == 3){ ?>
			<a href="">[3]</a> <?php }else{ ?> <a href="">3</a> <?php } } ?>
			<?php if(isset($value[SchoolService::RATE])){ if($value[SchoolService::RATE] == 4){ ?>
			<a href="">[4]</a> <?php }else{ ?> <a href="">4</a> <?php } } ?>
			<?php if(isset($value[SchoolService::RATE])){ if($value[SchoolService::RATE] == 5){ ?>
			<a href="">[5]</a> <?php }else{ ?> <a href="">5</a> <?php } } ?>
		</td>
		<td>
			<a href=<?php echo 'edit-school.html?id=' . $value[SchoolService::ID];?>>edit</a>
			<a href=<?php echo 'manage-schools.html?deleted=' . $value[SchoolService::ID];?>>delete</a>
		</td>
	</tr>
<?php } }?>
</table>